<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>投票活动列表</title>
    <link rel="stylesheet" type="text/css" href="css/el-index.css"/>
</head>
<body>
   <div id="father">
       <el-table
               :data="tableData"
               style="width: 100%">
           <el-table-column
                   prop="id"
                   label="编号"
                   width="80">
           </el-table-column>
           <el-table-column
                   prop="votename"
                   label="活动名称">
           </el-table-column>
           <el-table-column
                   prop="votetotal"
                   label="总票数">
           </el-table-column>
           <el-table-column
                   prop="votestart"
                   label="开始时间">
           </el-table-column>
           <el-table-column
                   prop="voteend"
                   label="结束时间">
           </el-table-column>
       </el-table>
       <el-pagination
               background
               layout="prev, pager, next"
               :total="1000">
       </el-pagination>
   </div>
   <script src="js/vue.js"></script>
   <script src="js/el-index.js"></script>
   <script src="js/axios.min.js"></script>
   <script>
       var app = new Vue({
           //挂载点
           el:"#father",
           //数据
           data:{
               tableData: []
           },
           //方法
           methods:{
           },
           //当 当前页面 被创建时，要执行的方法
           created(){
               console.log("查询投票活动列表")
               var _this = this;
               //发起ajax请求，获取当前session中的user
               axios.get("voteactivity/list").then(
                   function (res) {
                       _this.tableData = res.data.voteActivityList;
                       console.log(_this.tableData)
                   }
               )
           }
       })
   </script>
</body>
</html>